package com.gxkj.projects.myschoolx.binlog.v1.model;

import com.github.shyiko.mysql.binlog.event.EventType;
import lombok.Data;

import java.io.Serializable;
import java.util.Map;

@Data
public class CDCEvent implements Serializable {

    private  String binlogFilename = null;

    private String databaseName = null;
    private String tableName = null;


    private EventType eventType = null;//事件类型
    private long timestamp = 0;//事件发生的时间戳[MySQL服务器的时间]
    private long serverId = 0;


    private long nextPostion = 0;

    private Map<String,String> before = null;
    private Map<String,String> after = null;
    //
    private Boolean isDdl= null;
    private String sql = null;


    public CDCEvent(String binlogFilename,  String databaseName, String tableName, EventType eventType, long timestamp, long serverId,long nextPostion) {
        this.binlogFilename = binlogFilename;
        this.databaseName = databaseName;
        this.tableName = tableName;
        this.eventType = eventType;
        this.timestamp = timestamp;
        this.serverId = serverId;
        this.nextPostion= nextPostion;
    }
}
